package com.yc.taixin.model;


import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("serial")
@Entity
@Table(name = "t_s_user")
@org.hibernate.annotations.Table(appliesTo = "t_s_user", comment = "用户信息表")
public class TSUser extends IdEntity implements Serializable {

	/*@Column(columnDefinition = "varchar(500) DEFAULT NULL COMMENT '设备名称'")
	@Column(columnDefinition = "int default 0 comment '排序字段'")
	private int odr;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(columnDefinition = "datetime DEFAULT NULL COMMENT '创建时间'")
	private Date buildtime;*/

	private String username;// 用户名，账号
	private String password;//密码
	private String gender;//性别
	private String email;
	private Integer state;// 用户状态
	private String telephone;  //手机
	private String role;  //角色 DEFAULT '普通用户',
	private Date createDate;


	@Column(columnDefinition = "varchar(50) NOT NULL UNIQUE COMMENT '用户名'")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@JsonIgnore
	@Column(columnDefinition = "varchar(100) NOT NULL COMMENT '密码'")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(columnDefinition = "varchar(50) DEFAULT NULL COMMENT '性别'")
	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(columnDefinition = "varchar(50) DEFAULT NULL COMMENT 'email'")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(columnDefinition = "varchar(20) DEFAULT NULL COMMENT '用户状态'")
	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(columnDefinition = "varchar(50)  DEFAULT NULL COMMENT '手机号'")
	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(columnDefinition = "varchar(50) DEFAULT '普通用户' COMMENT '角色'")
	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(columnDefinition = "datetime DEFAULT NULL COMMENT '创建的时间'")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

}
